package com.ruoyi.bussiness.controller;

import com.ruoyi.common.core.api.ApiResult;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.pagination.Paging;
import com.ruoyi.common.domain.business.Orders;
import com.ruoyi.common.param.OrdersParam;
import com.ruoyi.common.service.business.OrdersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单Controller
 *
 * @author Song
 * @date 2024-10-29
 */
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/common/orders")
@Api(tags = "订单")
public class OrdersController extends BaseController {

    private final OrdersService ordersService;

    /**
     * 查询订单列表
     */
    @GetMapping("/page")
    @ApiOperation(value = "分页查询订单列表")
    public ApiResult<Paging<Orders>> page(OrdersParam ordersParam) {
        Paging<Orders> page = ordersService.pageOrders(ordersParam);;
        return ApiResult.ok(page);
    }


}
